
import {interpolateCubehelixDefault} from "d3";
import {buildScale, newInterpolator, quantize} from "./palette.js";

export function createSuexttauPalette(resolution = 500) {

    const bounds = [0.002, 2.500];  // units: τ
    const logBounds = bounds.map(Math.log);
    const interpolator = newInterpolator(interpolateCubehelixDefault, "cubehelix", logBounds);
    const colors = quantize(logBounds, [interpolator], resolution);

    return buildScale(bounds, colors, Math.log, Math.exp);

}
